﻿using RuoVea.ExSugar.Attributes;
using RuoVea.ExSugar.Entity;
using SqlSugar;
using System.ComponentModel;

namespace RuoVea.OmiApi.Article.Entitys;

/// <summary>
/// 文章收藏表
/// </summary>
[SugarTable(nameof(ArtFavorite), TableDescription = "文章收藏表")]
[Description("文章收藏表")] 
[SugarIndex($"IX_{nameof(ArtFavorite)}_{nameof(ArticleId)}_{nameof(Creator)}", nameof(ArticleId), OrderByType.Asc, nameof(Creator), OrderByType.Asc, true)]
[SugarIndex($"IX_{nameof(ArtFavorite)}_{nameof(Creator)}", nameof(Creator), OrderByType.Asc)]
[SugarIndex($"IX_{nameof(ArtFavorite)}_{nameof(CreateTime)}", nameof(CreateTime), OrderByType.Desc)]
public class ArtFavorite : EntityBase
{
    /// <summary>
    /// 文章ID
    /// </summary>
    [ConfigSugarColumn(columnKey:  nameof(ArticleId), columnDescription :"文章ID")]
    public long ArticleId { get; set; }

    /// <summary>
    /// 导航属性 - 文章（多对一）
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ArticleId))]
    [SugarColumn(IsIgnore = true)]
    public ArtArticle Article { get; set; }
     
}
